package me.zk.practice1.hw;

import java.util.ArrayList;
import java.util.Scanner;

public class HWBJ12 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String s = scanner.nextLine();

        ArrayList<String> l1 = new ArrayList<>();

        ArrayList<String> l2 = new ArrayList<>();


        String[] strs = s.split(" ");
        ArrayList<String> l = l1;
        for (int i = 0; i < strs.length; i++) {
            //分割
            String[] ss = strs[i].split("/");

            if (i==0) {
                l.add(ss[0]);
                continue;
            }
            if (ss[1].equals("N")) {
                l = l==l1?l2:l1;
            }
            l.add(ss[0]);
        }
        System.out.println(l1);
        System.out.println(l2);

    }
}
